﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Base.Utils.Logging;
using Spring.Context;
using Spring.Context.Support;
using Base.Utils.Factory;

namespace Base.Utils.Ioc
{
  public  class UtilsExposer
    {
      private ILogger _logger;
      public ILogger Logger
      {
          get
          {
              if (_logger != null)
                  return _logger;
              IApplicationContext ctx = ContextRegistry.GetContext();
              _logger = (ILogger)ctx.GetObject("ChinookLogger");

              if (_logger == null)
                  throw new TypeLoadException("Can not load object from container!");
              return _logger;
          }
      }
    }
}
